<template>
  <el-container>
    <!-- 布局：头部 -->
    <el-header height="30">
      <app-header />
    </el-header>

    <!-- 布局：主体 -->
    <el-container class="home-main-container">
      <!-- 左边 -->
      <!-- <vue-scroll style="width:500px"> -->
      <div class="left-panel-container">
        <el-aside width="550px" class="left-panel">
          <!-- <app-side-panel /> -->
          <app-stage />
        </el-aside>
      </div>
      <!-- </vue-scroll> -->

      <!-- 右边 -->

      <el-main class="main">
        <!-- <vue-scroll> -->
        <!-- <app-stage /> -->
        <app-side-panel />
        <!-- </vue-scroll> -->
      </el-main>

    </el-container>

  </el-container>
</template>

<script>
import AppHeader from './components/app-header'
import AppStage from './components/app-stage'
import AppSidePanel from './components/app-side-panel'
// import ChatRoom from './components/chatRoom/index.vue'
import socket from '@/socket/index'

export default {
  components: {
    AppHeader,
    AppStage,
    AppSidePanel
    // ChatRoom
  },
  data() {
    return {
      // ops: {
      //   bar: {
      //     background: 'rgba(64, 158, 255, 0.5)'
      //   }
      // }
    }
  },
  created() {
    // 客户端发送消息给服务器，告诉进入房间，服务端响应 room_info、广播 user_enter 事件
    const userInfo = {
      nickname: localStorage.getItem('nickname') || '',
      profile: localStorage.getItem('profile') || ''
    }
    socket.emit('enter', userInfo)
  },
  mounted() {
    this.$store.commit('updateNickname', localStorage.getItem('nickname'))
  },

  methods: {

  }
}
</script>

<style lang="scss" scoped>
.left-panel {
  padding: 20px;
}
.main{
  box-sizing: border-box;
  // height: calc(100vh - 32px);
}
// .left-panel-container{
//   overflow-y: scroll;
//   height: calc(100vh - 32px);
// }
.main::-webkit-scrollbar {
  display: none;
}
.left-panel-container::-webkit-scrollbar {
  display: none;
}

</style>
